define(['app'], function(app) {
	'use strict';

	//实例化方法
	var factory = function(Http) {

		//返回信息
		return {
			//积分一览
			getPointList: function(callback) {
				Http.post({
					method: 'member.point.search'
				}, function(result) {
					//函数回调
					if(callback)
						callback(result.result);
				}, function(e) {
					
				}, function() {
					
				});
			},
			//商品类型
			getGoodsType: function(callback) {
				Http.post({
					method: 'member.integral.goodstype'
				}, function(result) {
					//函数回调
					if(callback)
						callback(result.result);
				}, function(e) {
					
				}, function() {
					
				});
			},
			//商品列表
			getGoodsList: function(type,nPage,callback,calldone) {
				Http.post({
					method: 'member.integral.goods',
					type:type,
					pagelimit: 10,
					nPage: nPage
				}, function(result) {
					//函数回调
					if(callback)
						callback(result.result);
				}, function(e) {
					
				}, function() {
					if(calldone)
						calldone();
				});
			}
		
		};
	}

	factory.$inject = ['Http'];
	return app.registerService("Mypoint", factory);
});